package com.jy.admin.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.jy.admin.db.dao.AgentDao;
import com.jy.admin.db.entity.AgentEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
* User: zxp
* Date: 2022-06-14
* Time: 16:10:38.520
*/

@Repository
public class AgentDaoImpl extends AbstractBaseMapper<AgentEntity> implements AgentDao {

    @Override
    public AgentEntity queryAgent(String userCode) {
        Map<String, Object> params = new HashMap<>();
        params.put("userCode",userCode);
        return getSqlSession().selectOne(this.getStatement("queryAgent"), params);
    }

    @Override
    public String queryAgentByOrderNo(String merchantCode, String queryDate, String orderNo) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchantCode",merchantCode);
        params.put("queryDate",queryDate);
        params.put("orderNo",orderNo);
        return getSqlSession().selectOne(this.getStatement("queryAgentByOrderNo"),params);
    }
    @Override
    public String queryAgentByMobile(String merchantCode, String queryDate, String mobile) {
        Map<String, Object> params = new HashMap<>();
        params.put("merchantCode",merchantCode);
        params.put("queryDate",queryDate);
        params.put("mobile",mobile);
        return getSqlSession().selectOne(this.getStatement("queryAgentByMobile"),params);
    }

    @Override
    public String queryAgentByWhatsApp(String queryDate, String whatsapp) {
        Map<String, Object> params = new HashMap<>();
        params.put("queryDate",queryDate);
        params.put("whatsapp",whatsapp);
        return getSqlSession().selectOne(this.getStatement("queryAgentByWhatsApp"),params);
    }
}